#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isPalindrome(string s) {
        string rs;
        for (auto e : s)
        {
            if (e >= 'A' && e <= 'Z')
                rs += e + 32;
            else if (e >= 'a' && e <= 'z')
                rs += e;
            else if (e >= '0' && e <= '9')
                rs += e;
            else
                continue;
        }
        int left = 0;
        int right = rs.size() - 1;
        while (left < right)
        {
            if (rs[left++] != rs[right--])
                return false;
        }
        return true;
    }
};